package com.inspectortime.webapp;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import com.inspectortime.domain.Inspection;
import com.inspectortime.repository.Repository;
import com.inspectortime.webapp.util.HttpSessionUtils;

public class ReviewInspectionQuoteController implements Controller {
	
	private Repository repository;
	private String successView;
	
	public void setSuccessView(String s) {
		successView = s;
	}
	
    public void setRepository(Repository repository) {
		this.repository = repository;
	}

	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		
    	Inspection inspection = HttpSessionUtils.retrieveWizardInspection(request, repository);
    	
        ModelAndView mv = new ModelAndView(successView);
        mv.addObject("inspection", inspection);
        return mv;

	}
	
}
